home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Explore Yellowstone
/
Explore Yellowstone (1997)(The Learning Company)[PC-Mac].iso
/
mac
/
ACTXCLUD.DIR
/
00001_Script_Main Movie
next >
Wrap
Text File
|
1996-02-28
|
15KB
|
500 lines
--> Main Movie Script
-- for ACTXCLUD.DIR
----------------------
on StartMovie
global PathSepChar, HowManyActivities, ThisRegion, RangerSprite
global glActivityData, guideFlag, glAnsweredList
set the ItemDelimiter = "/"
set RangerSprite = 23
if the machineType = 256 then
set PathSepChar = "\"
else
set PathSepChar = ":"
end if
if VoidP(ThisRegion) then
set ThisRegion = 1
end if
-- Performed when starting the Activity
-- Not performed if querrying the Guidebook
if guideFlag = False then
parseRegionActivityLine()
LoadExcludeList
-- get current value for HowManyActivities answered correctly
set HowManyActivities = 0
set glAnsweredList = []
set glAnsweredList = getAt(glActivityData, 2)
put count(glAnsweredList) into itemCount
put "itemCount:" itemCount
put min(glAnsweredList) into lowest
set correctAnswer = lowest + 1
repeat with x = 1 to itemCount
put getAt(glAnsweredList, x) into AnsweredActivity
if AnsweredActivity = correctAnswer then
set HowManyActivities = HowManyActivities + 1
end if
end repeat
-- adjust HowManyActivities for another series
if HowManyActivities > 5 then
set HowManyActivities = 0
else if HowManyActivities > 2 then
set HowManyActivities = HowManyActivities - 3
end if
end if
end
----------------------
on StopMovie
global RangerSprite
repeat with x = 1 to 24
puppetSprite x, false
end repeat
repeat with x = 18 to 21
set the CastNum of sprite x to the number of cast "PixelCorners"
end repeat
set the CastNum of sprite RangerSprite to the number of cast "PixelCorners"
--updateStage
set the ItemDelimiter = ","
put " " into field "Clue"
end
----------------------
on parseRegionActivityLine
global ThisRegion, giWhichActivity, glActivityData, glRegionStructure, gsRegionLine
-- get gsRegionLine and glRegionStructure from field "UserList" (taken from YELLOW.PRF)
-- Get current value for giWhichActivity from gsRegionLine.
-- Use giWhichActivity to get glActivityData from glRegionStructure.
-- glRegionStructure holds all 9 of the Activities' answers for thisRegion.
put the ItemDelimiter into saveDlim
set the ItemDelimiter = ","
set gsRegionLine = 0
set regionLine = 0
put line (ThisRegion + 38) of field "UserList" into regionLine
put regionLine -- for now
put item 1 to 2 of regionLine into gsRegionLine
put "gsRegionLine:" gsRegionLine -- for now
put EMPTY into item 1 to 2 of regionLine
put EMPTY into char 1 of regionLine
set glRegionStructure = []
set glRegionStructure = value(regionLine)
put value(item 2 of gsRegionLine) into giWhichActivity -- for now (duplication)
set glActivityData = getAt(glRegionStructure, giWhichActivity)
put "glActivityData:" glActivityData
set the ItemDelimiter = saveDlim
end
----------------------
on SwitchRanger WhichRanger
put
put "entered SwitchRanger"
global ThisRegion, PathSepChar, RangerSprite
put WhichRanger & ".PIC" into WhichRanger
put the PathName & "FIELD" & PathSepChar & WhichRanger into WhichRanger
set the FileName of cast "Ranger01" to WhichRanger
puppetSprite RangerSprite, true
set the CastNum of sprite RangerSprite to the number of cast "Ranger01"
updateStage
end
----------------------
on GetQuestion
put
put "entered GetQuestion"
global glActivityData, glAnsweredList
put the ItemDelimiter into saveDlim
set the ItemDelimiter = ","
set maxQuestion = 6
-- set glActivityData = value(field "currentRegionActivityScores")
put "glActivityData:" & glActivityData
-- [questionNumber, [#correctQ1, #correctQ2, ... , #correctQ6]]
-- glAnsweredList = getAt (glActivityData, 2) already set in startMovie
-- section dealing w/ HowManyActivities
set questionNumber = getAt (glActivityData, 1)
set lowest = min(glAnsweredList)
repeat with i = 1 to maxQuestion
set questionNumber = questionNumber + 1
if questionNumber > maxQuestion then set questionNumber = 1
set Q = getAt(glAnsweredList, questionNumber)
if Q = lowest then exit repeat
end repeat
put "questionNumber" questionNumber
set the ItemDelimiter = saveDlim
return questionNumber
end
----------------------
on InitQuestion questionNumber
put
put "entered InitQuestion"
global WrongAnswer, WhichQuestion, PathSepChar
global ClueNum, RightNum, ThisRegion
if questionNumber then
set WhichQuestion = questionNumber
else
set WhichQuestion = 1
end if
put "WhichQuestion " & WhichQuestion
put "110010" & ThisRegion into WhichRanger
SwitchRanger WhichRanger
put EMPTY into field "Files"
repeat with x = 1 to 4
put item x of line WhichQuestion of field "ExcludeList" into line x of field "Files"
end repeat
--> Randomize right answer
put random(4) into WrongAnswer
put line WrongAnswer of field "Files" into line 1 of field "Files"
put item 1 of line WhichQuestion of field "ExcludeList" into line WrongAnswer of field "Files"
put "WrongAnswer " & WrongAnswer
repeat with x = 1 to 4
put item 1 of line x of field "Files" & ".PIC" into File
put the PathName & "PICS" & PathSepChar & File into File
put "File " & File
put "Pic" & x into WhichCast
set the FileName of cast WhichCast = File
puppetSprite x, TRUE
set the CastNum of sprite x to the number of cast WhichCast
end repeat
repeat with x = 8 to 11
puppetSprite x, TRUE
set the CastNum of sprite x to the number of cast "Eliminate"
-- initialize shared cast "save1" through "save4"
put "pixelCorners" into field "save" & (x - 7)
end repeat
updateStage
put item 5 of line WhichQuestion of field "ExcludeList" into field "Clue"
set ClueNum = 1
set RightNum = 0
end
----------------------
on saveQuestion
-- save users current place in shared cast when going to guidebook
-- with currently questions intact upon return
put line 1 of field "files" into field "savedAnswer1"
put line 2 of field "files" into field "savedAnswer2"
put line 3 of field "files" into field "savedAnswer3"
put line 4 of field "files" into field "savedAnswer4"
put field "Clue" into field "savedItem"
-- save any current BigX's in shared cast
repeat with x = 1 to 4
if the castNum of sprite (x + 17) = the number of cast "bigX" then
put the name of cast "bigX" into field "save" & x
else
put the name of cast "pixelCorners" into field "save" & x
end if
end repeat
put field "excludeList" into field "save5"
end
--------------------
on saveActivity
-- save users current activity when going to guidebook or closing
-- including already answered scores this activity
global giWhichActivity, glRegionStructure, glActivityData, gsRegionLine, thisRegion
-- glAnsweredList - previous score has been stored already
-- glActivityData - WhichQuestion and glAnsweredList have been stored already
put the ItemDelimiter into saveDlim
set the ItemDelimiter = ","
-- need to rebuild glRegionStructure
setAt(glRegionStructure, giWhichActivity, glActivityData)
-- hang on to current giWhichActivity (do not increment), but
-- rejoin glRegionStructure to a clone of gsRegionLine
-- in order to retain global version for possible use later
put gsRegionLine into regionLine
put ("," & glRegionStructure) after regionLine
set the ItemDelimiter = saveDlim
-- store regionLine in SHARED.DIR field "UserList"
put regionLine into line (ThisRegion + 38) of field "UserList"
end
--------------------
on initSavedQuestion
put
put "entered initSavedQuestion"
-- upon return from guidebook get last set of PICS and saved Clue
-- WrongAnswer, clueNum, and rightNum should be still intact
global guideFlag, pathSepChar, ThisRegion
set guideFlag = FALSE --***
put "110010" & ThisRegion into WhichRanger
SwitchRanger WhichRanger
repeat with x = 1 to 4
put field ("savedAnswer" & x) into file
put the pathName & "PICS" & pathSepChar & file & ".PIC" into file
put "PIC" & x into whichCast
set the fileName of cast whichCast = file
puppetSprite x, TRUE
set the castNum of sprite x to the number of cast whichCast
end repeat
repeat with x = 8 to 11
puppetSprite x, TRUE
-- set the castNum of sprite x to the number of cast "Eliminate"
end repeat
-- *** temp - attempt to debug guidebook icon turning into white box
set the castNum of sprite 8 to the number of cast "Eliminate"
set the castNum of sprite 9 to the number of cast "Eliminate"
set the castNum of sprite 10 to the number of cast "Eliminate"
set the castNum of sprite 11 to the number of cast "Eliminate"
-- restore any current BigX's from shared cast
repeat with x = 1 to 4
put field ("save" & x) into buttonState
puppetSprite (x + 17), TRUE
set the castNum of sprite (x + 17) = the number of cast buttonState
end repeat
updateStage --***?
put field "savedItem" into field "Clue"
put field "save5" into field "excludeList"
end
----------------------
on DoRightAnswer
put
put "entered DoRightAnswer"
global WhichChannel, RightNum, WhichQuestion
global PathSepChar, ThisRegion, HowManyActivities
global glAnsweredList, glActivityData, glRegionStructure, giWhichActivity, gsRegionLine
repeat with x = 8 to 11
if WhichChannel = x then
set WhichSprite = WhichChannel + 10
puppetSprite WhichSprite, true
set the castNum of sprite WhichSprite to the Number of cast "BIGX"
updateStage
exit repeat
end if
end repeat
set RightNum = RightNum + 1
if RightNum > 2 then
put the itemDelimiter into saveDelim
set the itemDelimiter = ","
-- increment score in glAnsweredList
set iCurrentScore = 0
put getAt(glAnsweredList, WhichQuestion) into iCurrentScore
set iCurrentScore = iCurrentScore + 1
setAt(glAnsweredList, WhichQuestion, iCurrentScore)
-- save current question number and answers. Increment HowManyActivities
setAt(glActivityData, 1, WhichQuestion)
setAt(glActivityData, 2, glAnsweredList)
set HowManyActivities = HowManyActivities + 1
put "HowManyActivities " & HowManyActivities
if HowManyActivities > 2 then
--> Finished activity. No badge.
-- rebuild glRegionStructure
setAt(glRegionStructure, giWhichActivity, glActivityData)
-- increment giWhichActivity in gsRegionLine
set giWhichActivity = giWhichActivity + 1
put "giWhichActivity:" & giWhichActivity
put giWhichActivity into item 2 of gsRegionLine
put "gsRegionLine:" gsRegionLine
-- rejoin glRegionStructure to gsRegionLine
put ("," & glRegionStructure) after gsRegionLine
put "gsRegionLine:" gsRegionLine
set the itemDelimiter = saveDelim
-- upload to field "UserList"
put gsRegionLine into line (ThisRegion + 38) of field "UserList"
-- do positive responses
put "110020" & ThisRegion into WhichRanger
SwitchRanger WhichRanger
repeat with x = 18 to 21
puppetSprite x, false
end repeat
put GetRightAnswer() into RangerSez
sound PlayFile 1, RangerSez
go to "NextActivity"
else
--> Not finished, yet
-- save current question number
setAt(glActivityData, 1, WhichQuestion)
set the itemDelimiter = saveDelim
-- do positive responses
put "110020" & ThisRegion into WhichRanger
SwitchRanger WhichRanger
--***BIG added this segment to remove BIG X's on Skip Question***
repeat with x = 18 to 21
puppetSprite x, false
end repeat
put GetRightAnswer() into RangerSez
sound PlayFile 1, RangerSez
go to "GetActivity"
end if
end if
end
----------------------
on GetRightAnswer
put
put "entered GetRightAnswer"
global PathSepChar, ThisRegion
put random(9) into WhichAnwer
put item 2 of line WhichAnwer of field "PositiveResponse" into RangerSez
put the PathName & "AUDIO" & PathSepChar & "REGION" & ThisRegion & ┬
PathSepChar & RangerSez into RangerSez
return RangerSez
end
----------------------
on DoWrongAnswer
put
put "entered DoWrongAnswer"
global WhichQuestion, PathSepChar, ThisRegion, glActivityData
-- save current question number
put the itemDelimiter into saveDelim
set the itemDelimiter = ","
setAt(glActivityData, 1, WhichQuestion)
set the itemDelimiter = saveDelim
put "110030" & ThisRegion into WhichRanger
SwitchRanger WhichRanger
repeat with x = 18 to 21
puppetSprite x, false
end repeat
put random(9) into WhichAnwer
put item 2 of line WhichAnwer of field "NegativeResponse" into RangerSez
put the PathName & "AUDIO" & PathSepChar & "REGION" & ThisRegion & ┬
PathSepChar & RangerSez into RangerSez
sound PlayFile 1, RangerSez
go to "GetActivity"
end
----------------------
on LoadExcludePointerList
put
put "entered LoadExcludePointerList"
put the PathName & "LISTS:XCLDPNTR.TXT" into WhichFile
put FileIO(mNew, "Read", WhichFile) into FileObj
if ObjectP(FileObj) then
put FileObj(mReadFile) into TextString
put TextString into field "ExcludePointerList"
FileObj(mDispose)
else
alert "LoadExcludePointerList failed to return XCLDPNTR.TXT"
end if
end
---------------------
on LoadExcludeList
put
put "entered LoadExcludeList"
global PathSepChar, ThisRegion
put EMPTY into field "ExcludeList"
put the Pathname & "LISTS" & PathSepChar & "XCLUD01.TXT" into WhichFile
put FileIO(mNew, "Read", WhichFile) into FileObj
if ObjectP(FileObj) then
put value(item 1 of line ThisRegion of field "ExcludePointerList") into CharNum
FileObj(mSetPosition, CharNum)
put FileObj(mReadLine) into TextString
put FileObj(mReadToken, "@", "@") into TextString
put TextString after field "ExcludeList"
FileObj(mDispose)
else
alert "LoadExcludeList failed to return XCLUD01.TXT"
end if
end
---------------------